package com.atguigu.commo.exception;

import com.atguigu.commo.result.ResultCodeEnum;
import lombok.Data;

import javax.xml.transform.Result;

@Data
public class StgyException extends RuntimeException {
    private Integer code;
    private String message;

    private Throwable throwable;

    public StgyException(Integer code, String message) {
        this(code, message,null);
    }
    public StgyException(Integer code,String message,Throwable throwable){
        this.code=code;
        this.message=message;
        this.throwable=throwable;
    }
    public StgyException(ResultCodeEnum codeEnum){
        this(codeEnum.getCode(), codeEnum.getMessage());
    }
    public StgyException(ResultCodeEnum codeEnum,Throwable throwable){
        this(codeEnum.getCode(), codeEnum.getMessage(),throwable);
    }
}


